<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form>  
  <p:toolbar styleClass="toolBarTitle">  
    <p:toolbarGroup align="left">  
    		 <p:outputLabel styleClass="title" value="MANTENIMIENTO DE CARROS" />
    </p:toolbarGroup>  
    <p:toolbarGroup align="right">  
        <p:commandLink styleClass="ui-icon ui-icon-disk" title="Nuevo" value="Nuevo"></p:commandLink>
        <p:commandLink styleClass="ui-icon ui-icon-wrench" title="Configuracion" value="Configuracion"></p:commandLink>
        <p:commandLink  value="Una Opción"></p:commandLink>
    </p:toolbarGroup>  
  
  </p:toolbar>  
</h:form>  
<p:scrollPanel styleClass="scpfrmMaint" mode="native"  >
<h:form id="formMain" styleClass="frmMaint">
	<p:dataTable var="car" value="#{tableBean.cars}" rowKey="#{car}" 
		id="tblMaintCountr" styleClass="tblMaint"
		paginator="true" rows="18" selection="#{tableBean.selectedCar}"
		selectionMode="single" filteredValue="#{tableBean.filteredCars}"
		rowsPerPageTemplate="18,25,30"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">

		<p:ajax event="rowSelect" oncomplete="carDialog.show()" update=":form1" listener="#{tableBean.openUpdate}"/>

		<f:facet name="header">  
			 <p:commandButton value="Nuevo" styleClass="btnNuevo" action="#{tableBean.openNew}"
			 	oncomplete="carDialog.show()" update=":form1" icon="ui-icon-plus" > 
			 </p:commandButton>
			 <h:outputText value="Lista de Carros" styleClass="tblTitle" />
			 <h:panelGroup layout="block" styleClass="tblTitle pnlExport">
				 <h:commandLink>
				 <p:graphicImage title="PDF" value="/resources/img/icons/16/pdf.png" />
				 <p:dataExporter type="pdf" target="tblMaintCountr" fileName="cars" /> 
				 </h:commandLink>
				 <h:commandLink>
				 <p:graphicImage title="XLS" value="/resources/img/icons/16/xls.png" />
				 <p:dataExporter type="xls" target="tblMaintCountr" fileName="cars" />  
				 </h:commandLink>
			 </h:panelGroup>
		</f:facet>

		<p:column headerText="Model" sortBy="model"
			filterBy="model">  
			            #{car.model}  
			        </p:column>

		<p:column headerText="Year" sortBy="car.year"
			filterBy="year">  
			            #{car.year}  
			        </p:column>

		<p:column headerText="Manufacturer" sortBy="manufacturer"
			filterBy="manufacturer">  
			            #{car.manufacturer}  
			        </p:column>

		<p:column headerText="Color" sortBy="car.color"
			filterBy="color">  
			            #{car.color}
			        </p:column>
	</p:dataTable>
	
</h:form>
</p:scrollPanel>
</html>